/*
 * @Date: 2022-03-04 11:07:17
 * @LastEditors: 春贰
 * @gitee: https://gitee.com/chun22222222
 * @github: https://github.com/chun222
 * @Desc: 
 * @LastEditTime: 2022-03-17 10:50:45
 * @FilePath: \web\src\api\module\user.js
 */

import http from '../http'

const Api = {
    list: '/user/list',
    add: '/user/add',
    edit: '/user/edit',
    tree: '/user/tree',
    permissions: '/user/permissions',
    setPermissions: '/user/setpermissions',
    roles: '/user/roles',
    setRoles: '/user/setroles', 
    remove: '/user/remove',  
    reloadinfo:'/user/reloadinfo'
}

 

export const list = data => {   
    return http.request({
        url: Api.list,
        data: data,
        method: 'POST'
    })
}

 

export const add = data => {   
    return http.request({
        url: Api.add,
        data: data,
        method: 'POST'
    })
}

export const edit = data => {     
    return http.request({
        url: Api.edit,
        data: data,
        method: 'POST'
    })
}

export const remove = data => {
    return http.request({
        url: Api.remove,
        data: data,
        method: 'POST'
    })
}

  

export const permissions = data => { 
    return http.request({
        url: Api.permissions,
        data: data,
        method: 'POST'
    })
}

export const setPermissions = data => {
    return http.request({
        url: Api.setPermissions,
        data: data,
        method: 'POST'
    })
}


export const roles = data => {
    return http.request({
        url: Api.roles,
        data: data,
        method: 'POST'
    })
}


export const setRoles = data => {
    return http.request({
        url: Api.setRoles,
        data: data,
        method: 'POST'
    })
}


export const reloadinfo = data => {
    return http.request({
        url: Api.reloadinfo,
        data: data,
        method: 'POST'
    })
}
